﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Service.BusinessLayer.Entities;
using Service.DataAccess.DataAccessHelper;
using System.Data.SqlClient;
using System.Data;
namespace Service.DataAccess.DataAccessLogic
{
    public class LoaiWash_DA
    {
        public void them(LoaiWash lw)
        {
            Helper help = new Helper();
            SqlParameter[] par = new SqlParameter[2];
            par[0] = new SqlParameter("@mawash", lw.Mawash);
            par[1] = new SqlParameter("@tenwash", lw.Tenwash);
            help.InsertQuery("sp_loaiwash_them", par);
        }
        public void sua(LoaiWash lw)
        {
            Helper help = new Helper();
            SqlParameter[] par = new SqlParameter[2];
            par[0] = new SqlParameter("@mawash", lw.Mawash);
            par[1] = new SqlParameter("@tenwash", lw.Tenwash);
            help.UpdateQuery("sp_loaiwash_sua", par);
        }
        public void xoa(string mawash)
        {
            Helper help = new Helper();
            SqlParameter[] par = new SqlParameter[1];
            par[0] = new SqlParameter("@mawash", mawash);
            help.DeleteQuery("sp_loaiwash_xoa", par);
        }
        public DataSet layds()
        {
            Helper help = new Helper();
            DataSet ds = new DataSet();
            ds = help.SelectQuery("sp_loaiwash_layds");
            return ds;
        }
    }
}
